package gemini.pollux.ui.client.page.content.product.producttype.list;

import gemini.basic.model.ProductType;
import gemini.pollux.ui.client.page.content.product.producttype.widget.ProductTypeTableWidget;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;

public class ProductTypeListView extends Composite implements
		ProductTypeListPresenter.Display {

	@UiTemplate("ProductTypeListView.ui.xml")
	interface MyUiBinder extends UiBinder<Panel, ProductTypeListView> {
	}

	private static final MyUiBinder binder = GWT.create(MyUiBinder.class);

	public ProductTypeListView() {
		initWidget(binder.createAndBindUi(this));
	}

	@UiField
	ProductTypeTableWidget ptwProductTypeList;
	
	@Override
	public ProductTypeTableWidget getProductTypeTableWidget(){
		return ptwProductTypeList;
	}

	@Override
	public void showProductTypes(List<ProductType> productTypes){
		ptwProductTypeList.loadData(productTypes);
	}

	@Override
	public Widget asWidget() {
		return this;
	}

	@Override
	public void initCustom() {
		// TODO Auto-generated method stub
	}
}
